package com.baiyi.service.serialservice.serialdataservice.data.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class DataHeader implements Parcelable{

    private int SeqNumber = -1;
    private int AckNumber = -1;

    private int ContentLength = -1;
    private String ContentType = "-1";
    private String FileName = "-1";
    private int FileSize = -1;
    private int ContentRange = -1;
    private long Counter = -1;
    private long Date = -1;
    private int msgId = -1;

    protected DataHeader(Parcel in) {
        SeqNumber = in.readInt();
        AckNumber = in.readInt();
        ContentLength = in.readInt();
        ContentType = in.readString();
        FileName = in.readString();
        FileSize = in.readInt();
        ContentRange = in.readInt();
        Counter = in.readLong();
        Date = in.readLong();
        msgId = in.readInt();
    }

    public DataHeader() {
    }

    public static final Creator<DataHeader> CREATOR = new Creator<DataHeader>() {
        @Override
        public DataHeader createFromParcel(Parcel in) {
            return new DataHeader(in);
        }

        @Override
        public DataHeader[] newArray(int size) {
            return new DataHeader[size];
        }
    };

    public int getContentLength() {
        return ContentLength;
    }

    public void setContentLength(int contentLength) {
        ContentLength = contentLength;
    }

    public String getContentType() {
        return ContentType;
    }

    public void setContentType(String contentType) {
        ContentType = contentType;
    }

    public String getFileName() {
        return FileName;
    }

    public void setFileName(String fileName) {
        FileName = fileName;
    }

    public int getFileSize() {
        return FileSize;
    }

    public void setFileSize(int fileSize) {
        FileSize = fileSize;
    }

    public int getContentRange() {
        return ContentRange;
    }

    public void setContentRange(int contentRange) {
        ContentRange = contentRange;
    }

    public long getCounter() {
        return Counter;
    }

    public void setCounter(long counter) {
        Counter = counter;
    }

    public int getSeqNumber() {
        return SeqNumber;
    }

    public void setSeqNumber(int seqNumber) {
        SeqNumber = seqNumber;
    }

    public int getAckNumber() {
        return AckNumber;
    }

    public void setAckNumber(int ackNumber) {
        AckNumber = ackNumber;
    }

    public long getDate() {
        return Date;
    }

    public void setDate(long date) {
        Date = date;
    }

    public int getMsgId() {
        return msgId;
    }

    public void setMsgId(int msgId) {
        this.msgId = msgId;
    }


    @Override
    public String toString() {
        return "DataHeader{" +
                "SeqNumber=" + SeqNumber +
                ", AckNumber=" + AckNumber +
                ", ContentLength=" + ContentLength +
                ", ContentType='" + ContentType + '\'' +
                ", FileName='" + FileName + '\'' +
                ", FileSize=" + FileSize +
                ", ContentRange=" + ContentRange +
                ", Counter=" + Counter +
                ", Date=" + Date +
                ", msgId=" + msgId +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(SeqNumber);
        dest.writeInt(AckNumber);
        dest.writeInt(ContentLength);
        dest.writeString(ContentType);
        dest.writeString(FileName);
        dest.writeInt(FileSize);
        dest.writeInt(ContentRange);
        dest.writeLong(Counter);
        dest.writeLong(Date);
        dest.writeInt(msgId);
    }
}
